package com.example.lenovo.demo.view;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.lenovo.demo.R;
import com.example.lenovo.demo.presenter.TravelsFgPresenter;
import com.example.lenovo.demo.view.ifgview.ITravelsFragment;
import com.handmark.pulltorefresh.library.PullToRefreshListView;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;


/**
 * Created by Administrator on 2017/1/9.
 */
@ContentView(R.layout.fragment_travels)
public class TravelsFragment extends BaseFragment implements ITravelsFragment {
    private TravelsFgPresenter travelsFgPresenter;
    private View view;

    @ViewInject(R.id.travels_lv)
    private PullToRefreshListView lv;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = x.view().inject(this,inflater,container);
        init();
        travelsFgPresenter.initData();
        return  view;
    }

    private void init() {
        travelsFgPresenter = new TravelsFgPresenter(this);
    }

    @Override
    public PullToRefreshListView getLV() {
        return lv;
    }

    @Override
    public Context getTravelsContext() {
        return getContext();
    }

}
